home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir39
/
adclk100.zip
/
ADJCLOCK.DOC
next >
Wrap
Text File
|
1993-06-29
|
5KB
|
147 lines
ADJCLOCK.COM (ADJust CLOCK) [v1.0: 29/6/1993]
============ ==============
Program for automatic (non-resident) PC-clock adjustment. When
called periodically, the program tries to compensate for clock
inaccuracy.
This program is FreeWare: It might be distributed and used freely.
There exists no warranty, and the author shall not be liable for any
loss or damage due to using this program.
Written in C using Borland's great compiler by
Sverre H. Huseby
Bjoelsengt. 17
N-0468 Oslo
Norway
Phone: +47 22 23 05 39
Internet: sverrehu@ifi.uio.no
I you like the program, please do me a small favour: Mail me and
tell me about it. That's worth more than a few bucks!
Description
-----------
The Real Time Clock in many PC's (mine for instance) don't seem to
keep the `real time' after all. The purpose of this program is to
periodically (for instance at each boot) adjust the date/time with a
clock-dependent number of seconds. How many seconds to add or
subtract also depends on the time passed since the last adjustment.
To keep track of this, the program updates a small file. This file
is located in the same directory as the program itself.
For all this to work, the program needs to know the unaccuracy of
your computer's clock. This is measured once and for all when you
start using the program. The drawback is that this takes time, but
fortunately, you won't notice.
ADJCLOCK accepts several different commands on the command line. The
overall syntax is:
ADJCLOCK command [parameters]
where command is a letter telling the program what to do, and the
parameters (not needed for all commands) vary according to the
command.
Several commands accept date and time as parameters. The current
version of ADJCLOCK uses European date and time format, that is:
Date: DD/MM/YY
Time: HH:MM or HH:MM:SS
Note that the time is given using 24 hours (that is: HH is 0-23).
All commands and their respective parameters are explained below.
Any parameters in [ ] are optional. The brackets should not be
entered.
Setting up ADJCLOCK
-------------------
Here's how to teach this program the unaccuracy of your computer's
clock. Perform the following command:
ADJCLOCK N [date] [time]
This tells ADJCLOCK to start a New accuracy measure. A file named
ADJCLOCK.DAT is created in the directory where ADJCLOCK is.
The optional date and time gives the current (correct) time. If
given, the PC's clock is set to reflect this. If not, the PC's time
is taken as correct.
Now just let time pass. Wait several days or weeks (the longer the
better). You can do whatever you want (including turning off the
computer, of course), as long as you DO NOT adjust the computer's
clock. When the clock has become wrong enough, execute the following
command:
ADJCLOCK S [date] time
to Set the correct date and time. If the computer's date is correct,
the date can be omitted. The time _must_ be given. Since it is the
first time ADJCLOCK is used to set the time (it figures this out
from the contents of ADJCLOCK.DAT), it will check out how wrong the
clock was, and store information about this in ADJCLOCK.DAT.
Using ADJCLOCK
--------------
If you have performed the steps above, ADJCLOCK now knows the inac-
curacy of your computer's clock. It's then time to start adjusting
it. Enter the following line in your AUTOEXEC.BAT:
ADJCLOCK A [-q]
telling the program to [Quietly] Adjust your computer's clock. What
ADJCLOCK does when it gets this command, is checking ADJCLOCK.DAT to
see when the clock was last adjusted. It then calculates a new (and
hopefully more correct) time based on the inaccuracy measure.
Now it is clear that ADJCLOCK needs to know when the clock was last
adjusted (correct). This should ring a bell. What happens if you (or
some program) manually adjusts the clock? ADJCLOCK won't know this,
thus making the clock incorrect the next time it is called. We some-
how need to tell ADJCLOCK that the clock is corrected manually. Use
the command
ADJCLOCK U
to make ADJCLOCK Update the ADJCLOCK.DAT -file. You can also Set the
clock using
ADJCLOCK S [date] [time]
This way the program automatically updates the .DAT -file.
Finally
-------
If you decide to use this program, thanks! I would be happy hearing
from you if you find any bugs, have any suggestions, or just to know
that one more person uses my program.
Sverre.